How Do I Style Nodes and Connections?

If you are using simple shape nodes and connections, see Node Visuals and Connection Visuals.

If you are creating custom node types, or want to style nodes and connections other than simple ones, you can create a Style to control the appearance or a node or connection. The Style’s TargetType should be DiagramNodeElement or DiagramConnectionElement as appropriate. Set the NodeTemplate property to define a data template to be bound to the node object, or the Template property to fully customize the appearance of the element. See the Foundation documentation on Node Visuals and Connection Visuals for more information.

Refer to the CustomStyle.FlowDiagrams and Cosmic.StarDiagrams samples for a comprehensive illustration of styling. Refer to the CustomNodeType.FlowDiagrams sample for information about templating your own nodes.